<template>
  <div>
    <!-- Header中能够跳转路由，所以Footer中可以直接使用$route.meta.isShowFooter -->
    <Header></Header>
    <router-view></router-view>
    <Footer v-show="$route.meta.isShowFooter"></Footer>
  </div>
</template>

<script>
import Header from './components/Header/Header.vue';
import Footer from './components/Footer/Footer.vue';
import TypeNav from './components/TypeNav';
import Pagination from './components/Pagination';
import Vue from 'vue';

import { mapActions } from 'vuex'

// 将TypeNav注册为全局组件
Vue.component(TypeNav.name, TypeNav);
// 将Pagination注册为全局组件
Vue.component(Pagination.name, Pagination)


export default {
  name: 'App',
  mounted() {
    // console.log('----', this.$route);
    // console.log(this);
    this.getCategoryListData();
  },
  methods: {
    ...mapActions('home', ['getCategoryListData']),
  },
  components: {
    Header,
    Footer
  }
}
</script>

<style scoped>

</style>
